﻿Public Class FrmDangNhap

    Private Sub FrmDangNhap_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        'My.Settings.Save()
    End Sub

    Private Sub FrmDangNhap_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing


    End Sub


    Private Sub btndangnhap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndangnhap.Click
        If NhanVien.DangNhap(txtmanv.Text, txtmatkhau.Text) Then
            If cbghinho.Checked Then
                My.Settings.MaNV = txtmanv.Text
                My.Settings.MatKhau = txtmatkhau.Text
            Else
                My.Settings.MaNV = ""
                My.Settings.MatKhau = ""
            End If
            Me.Close()
        Else
            MsgBox("Sai tên đăng nhập hoặc mật khẩu", MsgBoxStyle.Information, "Thông tin")
        End If
    End Sub

    Private Sub btnhuybo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhuybo.Click
        Me.Close()
    End Sub

    Private Sub cbghinho_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbghinho.CheckedChanged
        My.Settings.NhoMK = cbghinho.Checked
    End Sub

    Private Sub FrmDangNhap_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class